/**
 * @author haixuanwo
 * @email haixuanwo_clark@hotmail.com
 * @date 2021-03-25
 * @brief sqlite3数据库类
 */

#ifndef MY_SQLITE_H
#define MY_SQLITE_H

#include <sqlite3.h>
#include <string>

#define STUDENT_MANAGE_SYSTEM "studentManageSystem.db"

/**
 * @brief 数据库类，实现数据库的创建即数据的增删查改
 */
class mySqlite
{
public:
    mySqlite(const char *db_name);
    bool exec_sql_cmd(const char* cmd, void *data = nullptr);
    bool sql_select(const char* cmd, std::string &tableData);
    ~mySqlite();

private:
    static int callback(void *data, int argc, char **argv, char **azColName);

    sqlite3 *db;
};

#endif

